﻿public class OrderDetail
{
    public string ProductName { get; set; }
    public decimal UnitPrice { get; set; }
    public int Quantity { get; set; }

    public override bool Equals(object obj)
    {
        if (obj is OrderDetail detail)
        {
            return ProductName == detail.ProductName;
        }
        return false;
    }

    public override int GetHashCode()
    {
        return ProductName.GetHashCode();
    }

    public override string ToString()
    {
        return $"商品名称: {ProductName}, 单价: {UnitPrice:C}, 数量: {Quantity}";
    }
}
